
import java.awt.*;

import javax.swing.*;
import javax.swing.border.LineBorder;

public class WestPanel extends JPanel
{

	private final int WIDTH = 100;
	private final int HEIGHT = 495;
	
	// no corner lots needed (they are on the north and south panels
	
	private PropertyLot NewYorkAve;
	private PropertyLot TennesseeAve;
	private CardDrawLot Chest;
	private PropertyLot StJamesPlace;
	private RailroadLot PennsylvaniaRailroad;
	private PropertyLot VirginiaAve;
	private PropertyLot StatesAve;
	private UtilityLot ElectricCompany;
	private PropertyLot StCharlesPlace;
	
	public WestPanel()
	{
		Color lightpurple = new Color(209,72,128);		
		setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
		setBackground(Color.white);
		setPreferredSize(new Dimension(WIDTH, HEIGHT));
		
		NewYorkAve = new PropertyLot("NewYorkAve", "property", "west", 200, Color.orange,
				 16, 80, 220, 600, 800, 1000, 100, 100, 100);
		TennesseeAve = new PropertyLot("TennesseeAve", "property", "west", 180, Color.orange,
				 14, 70, 200, 550, 750, 950, 90, 100, 100);
		Chest = new CardDrawLot("ChestWest", "cardDraw", "west", "CommunityChest", 2);
		StJamesPlace = new PropertyLot("StJamesPlace", "property", "west", 180, Color.orange,
				 14, 70, 200, 550, 750, 950, 90, 100, 100);
		PennsylvaniaRailroad = new RailroadLot("PennsylvaniaRailroad", "railroad", "west");
		VirginiaAve = new PropertyLot("VirginiaAve", "property", "west", 160, lightpurple,
				 12, 60, 180, 500, 700, 900, 80, 100, 100);
		StatesAve = new PropertyLot("StatesAve", "property", "west", 140, lightpurple,
				 10, 50, 150, 450, 625, 750, 70, 100, 100);
		ElectricCompany = new UtilityLot("ElectricCompany", "utility", "west");
		StCharlesPlace = new PropertyLot("StCharlesPlace", "property", "west", 140, lightpurple,
				 10, 50, 150, 450, 625, 750, 70, 100, 100);
		
		add(NewYorkAve);
		add(TennesseeAve);
		add(Chest);
		add(StJamesPlace);
		add(PennsylvaniaRailroad);
		add(VirginiaAve);
		add(StatesAve);
		add(ElectricCompany);
		add(StCharlesPlace);
	} // end WestPanel constructor
	
	public void buildHouses(int num, String name)
	{
		if(name == "StCharlesPlace")
		{
			StCharlesPlace.setNumHouses(num);
		}
		else if(name == "StatesAve")
		{
			StatesAve.setNumHouses(num);
		}
		else if(name == "VirginiaAve")
		{
			VirginiaAve.setNumHouses(num);
		}
		else if(name == "StJamesPlace")
		{
			StJamesPlace.setNumHouses(num);
		}
		else if(name == "TennesseeAve")
		{
			TennesseeAve.setNumHouses(num);
		}
		else if(name == "NewYorkAve")
		{
			NewYorkAve.setNumHouses(num);
		}
	}
	
	public void removeAllHouses(String name)
	{
		if(name == "StCharlesPlace")
		{
			StCharlesPlace.setNumHouses(0);
		}
		else if(name == "StatesAve")
		{
			StatesAve.setNumHouses(0);
		}
		else if(name == "VirginiaAve")
		{
			VirginiaAve.setNumHouses(0);
		}
		else if(name == "StJamesPlace")
		{
			StJamesPlace.setNumHouses(0);
		}
		else if(name == "TennesseeAve")
		{
			TennesseeAve.setNumHouses(0);
		}
		else if(name == "NewYorkAve")
		{
			NewYorkAve.setNumHouses(0);
		}
	}
	
	public void buildHotel(String name)
	{
		if(name == "StCharlesPlace")
		{
			StCharlesPlace.setNumHotels(1);
		}
		else if(name == "StatesAve")
		{
			StatesAve.setNumHotels(1);
		}
		else if(name == "VirginiaAve")
		{
			VirginiaAve.setNumHotels(1);
		}
		else if(name == "StJamesPlace")
		{
			StJamesPlace.setNumHotels(1);
		}
		else if(name == "TennesseeAve")
		{
			TennesseeAve.setNumHotels(1);
		}
		else if(name == "NewYorkAve")
		{
			NewYorkAve.setNumHotels(1);
		}
	}
} // end class WestPanel